
/**********************************************************************************\
** 文件名称: RGB.h
** 创建人员: YCG
** 创建日期: 2018-11-30
** 文档描述:
** 版本代号: V0.1
** 版本说明: 初始版本
\********************************************************************************/
#ifndef __R_G_B_H_
#define __R_G_B_H_
#include "main.h"
#include "spi.h"
#define RGB_MAX_NUM   100
#define RGB_START_NUM 0
#define RGB_END_NUM   4
#define RGB_SPI_BUF_NUM   (12*RGB_MAX_NUM+RGB_START_NUM+RGB_END_NUM)

#define RGB_MUL   0.1
#define RGB_MUL_R RGB_MUL
#define RGB_MUL_G RGB_MUL
#define RGB_MUL_B RGB_MUL

typedef struct _RGB_TypeDef
{
    uint8_t green;
    uint8_t red;
    uint8_t blue;
} RGB_TypeDef;

void RGB_Init(uint8_t num);
void RGB_Set8Color(uint8_t num, uint8_t r, uint8_t g, uint8_t b);
void RGB_Set32Color(uint8_t num, uint32_t color);
void RGB_SetOneColor(uint8_t num, uint32_t color) ;
void RGB_SetAllColor(uint8_t r, uint8_t g, uint8_t b);
void RGB_Update(void);
uint32_t RGB_Color(uint8_t r, uint8_t g, uint8_t b);
uint32_t Wheel(uint8_t WheelPos);
void rainbow(uint16_t wait);
void rainbowCycle(uint16_t wait);
void theaterChase(uint32_t c, uint16_t wait);
void theaterChaseRainbow(uint16_t wait);
void colorWipe(uint32_t c, uint16_t wait);
void RGB_Test(void);
#endif

/********************************End of File************************************/
